package com.gdut.simple.contract;

import com.gdut.simple.basic.IPresenter;
import com.gdut.simple.basic.IView;
import com.gdut.simple.common.RequestCallback;
import com.gdut.simple.data.entity.User;
import com.gdut.simple.model.IUpdateInfoModel;

public interface UpdateInfoContract {

    interface View extends IView<Presenter> {

        User getUser();

        String getValue();

        void next();

    }

    interface Presenter extends IPresenter {

        void update(UpdateStrategy strategy);

    }

    class UpdateStrategy {

        private IUpdateInfoModel updateModel;

        public UpdateStrategy(IUpdateInfoModel updateModel) {
            this.updateModel = updateModel;
        }

        public void update(User user, String value, RequestCallback<String> callback) {
            updateModel.update(user, value, callback);
        }

    }
}
